History log of /u-boot/include/remoteproc.h
Revision Date Author Comments
# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# fb49d6c2 21-Mar-2024 MD Danish Anwar <danishanwar@ti.com>

remoteproc: uclass: Add methods to load firmware to rproc and boot rproc

Add APIs to set a firmware_name to a rproc and boot the rproc with the
same firmware.

Clients can call rproc_set_firmware() API to set firmware_name for a rproc
whereas rproc_boot() will load the firmware set by rproc_set_firmware() to
a buffer by calling request_firmware_into_buf(). rproc_boot() will then
load the firmware file to the remote processor and start the remote
processor.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Acked-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# e2e69291 18-Jan-2024 Max Krummenacher <max.krummenacher@toradex.com>

headers: don't depend on errno.h being available

These headers follow the pattern:

| #if CONFIG_IS_ENABLED(FANCY_FEATURE)
| void foo(void);
| #else
| static inline void foo(void) { return -ENOSYS; }
| #endif

In the #else path ENOSYS is used, however linux/errno.h is not included.
If errno.h has not been included already the compiler errors out even
if the inline function is not referenced.

Make those headers self contained.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a94a4071 01-Nov-2023 Nishanth Menon <nm@ti.com>

tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# a03df898 27-Jan-2022 Keerthy <j-keerthy@ti.com>

remoteproc: uclass: Add remoteproc resource handling helpers

Add remoteproc resource handling helpers. These functions
are primarily to parse the resource table and to handle
different types of resources. Carveout, devmem, trace &
vring resources are handled.

Signed-off-by: Keerthy <j-keerthy@ti.com>
[Amjad: fix redefinition of "struct resource_table" and compile warnings ]
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 185f812c 19-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

doc: replace @return by Return:

Sphinx expects Return: and not @return to indicate a return value.

find . -name '*.c' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

find . -name '*.h' -exec \
sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \;

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# caa4daa2 03-Dec-2020 Simon Glass <sjg@chromium.org>

dm: treewide: Rename 'platdata' variables to just 'plat'

We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).

Rename some of the latter variables to end with 'plat' for consistency.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# b608c54b 15-Sep-2020 Sean Anderson <seanga2@gmail.com>

remoteproc: Remove unused function rproc_elf_sanity_check

This function is never used anywhere, and it also tries to log with a
nonexistant device.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# ffcb880d 30-Oct-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: elf_loader: Add elf resource table load support

Add rproc_elf_load_rsc_table(), which searches for a resource table in
an elf64/elf32 image, and if found, copies it to device memory.
Add also the elf32 and elf64 variants of this API.
Add a test for this.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81e39fbd 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce rproc_elf_get_boot_addr() api

Introduce rproc_elf_get_boot_addr() that returns the entry point of
the elf file. This api auto detects the 64/32 bit elf file and returns
the boot addr accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 856c0ad4 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Introduce a common elf loader and checker functions

Introduce a common remoteproc elf loader and checker functions that
automatically detects the 64 bit elf file or 32 bit elf file and
loads/checks the sections accordingly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# e3c4d6f0 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf-loader: Add 64 bit elf loading support

The current rproc-elf-loader supports loading of only 32 bit elf files.
Introduce support for loading of 64 bit elf files in rproc-elf-loader.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 14d963d1 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: elf_loader: Always check the validity of the image before loading

rproc_elf32_load_image() rely on user to send a valid address for elf loading.
Instead do a sanity check on the address passed by user. This will help
all rproc elf users to not call sanity_check explicitly before calling
elf_loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# c08eb936 04-Sep-2019 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: ops: Add elf section size as input parameter to device_to_virt api

Introduce a new parameter "size" that accepts size of the region to
remoteproc ops callback device_to_virt(). This can enforce more checks
on the region that device_to_virt() is dealing with.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 26557d10 19-Jul-2019 Suman Anna <s-anna@ti.com>

remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 7a7c4cb0 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add elf file load support

The current implementation supports only binary file load.
Add helpers to support ELF32 format (sanity check, and load).
Note that since an ELF32 image is built for the remote processor, the
load function uses the device_to_virt ops to translate the addresses.
Implement a basic translation for sandbox_testproc.

Add related tests. Test result:
=> ut dm remoteproc_elf
Test: dm_test_remoteproc_elf: remoteproc.c
Test: dm_test_remoteproc_elf: remoteproc.c (flat tree)
Failures: 0

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 163b7d77 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: add device_to_virt ops

Introduce the device_to_virt function to allow translation between
device address (remote processor view) and virtual address (main
processor view).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 31a839f8 31-May-2019 Fabien Dessenne <fabien.dessenne@st.com>

remoteproc: fix function headers

Add full function comment headers.
Fix rproc_is_initialized() return value description.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>


# 81ae6e6d 27-Aug-2018 Lokesh Vutla <lokeshvutla@ti.com>

remoteproc: Allow for individual remoteproc initialization

Existing rproc_init() api tries to initialize all available
remoteproc devices. This will fail when there is dependency
among available remoteprocs. So introduce a separate api
that allows to initialize remoteprocs individually based
on id.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>


# 83d290c5 06-May-2018 Tom Rini <trini@konsulko.com>

SPDX: Convert all of our single license tags to Linux Kernel style

When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.

In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.

This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.

Signed-off-by: Tom Rini <trini@konsulko.com>


# ddf56bc7 17-Sep-2015 Nishanth Menon <nm@ti.com>

drivers: Introduce a simplified remoteproc framework

Many System on Chip(SoC) solutions are complex with multiple processors
on the same die dedicated to either general purpose of specialized
functions. Many examples do exist in today's SoCs from various vendors.
Typical examples are micro controllers such as an ARM M3/M0 doing a
offload of specific function such as event integration or power
management or controlling camera etc.

Traditionally, the responsibility of loading up such a processor with a
firmware and communication has been with a High Level Operating
System(HLOS) such as Linux. However, there exists classes of products
where Linux would need to expect services from such a processor or the
delay of Linux and operating system being able to load up such a
firmware is unacceptable.

To address these needs, we need some minimal capability to load such a
system and ensure it is started prior to an Operating System(Linux or
any other) is started up.

NOTE: This is NOT meant to be a solve-all solution, instead, it tries to
address certain class of SoCs and products that need such a solution.

A very simple model is introduced here as part of the initial support
that supports microcontrollers with internal memory (no MMU, no
execution from external memory, or specific image format needs). This
basic framework can then (hopefully) be extensible to other complex SoC
processor support as need be.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>